<template>
 <view class="my-settle-container">
   <!-- 全选 -->
   <label class="radio" @click="changeAllState">
     <radio :checked="isFullChecked" color="#c00000" /><text>全选</text>
   </label>
   <!-- 总计 -->
   <view class="amount-box">
      总计:<text class="amount">￥{{checkGoodsAmount}}</text>
   </view>
   <!-- 结算 -->
   <view class="settle">
     结算({{checkedCount}})
   </view>
 </view>
</template>
<script>
  import {mapGetters,mapMutations} from 'vuex'
  export default{
    computed:{
      ...mapGetters('m_cart',['checkedCount','total','checkGoodsAmount']),
      isFullChecked(){
        return this.total===this.checkedCount
      }
    },
    methods:{
      ...mapMutations('m_cart',['updateAllGoodsState']),
      changeAllState(){
        console.log(this.isFullChecked)
        this.updateAllGoodsState(!this.isFullChecked)
      }
    },
    
  }
</script>
<style lang="scss">
  .my-settle-container{
    z-index: 999;
    height: 50px;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left:5px;
    font-size: 14px;
    .radio{
      
    }
    .amount-box{
      .amount{
        color: #C00000;
        font-weight: bold;
      }
    }
    .settle{
      background-color: #C00000;
      height: 50px;
      min-width: 100px;
      text-align: center;
      line-height: 50px;
      color: white;
      
    }
  }
</style>
